package happywing.server.data;

import javax.jdo.PersistenceManager;

public class UserEntityMgr {
	private static final UserEntityMgr instance = new UserEntityMgr();
    private UserEntityMgr() {
    }
    
    public UserEntityMgr GetInstance(){
    	return instance;
    }
    
    public UserEntity GetEntityByLoginname(String loginname){
    	PersistenceManager pm = PMF.get().getPersistenceManager();
    	String query = "select from " + UserEntity.class.getName();
    	UserEntity userEntity = (UserEntity) pm.newQuery(query).execute();
    	return userEntity;
    }
}
